<%@ page import="com.sunelec.pojo.Users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">
<head>
    <title>发电量统计表</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${pageContext.request.contextPath}/static/css/font-awesome.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/page.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/stationRunTable.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/laydate/theme/default/laydate.css" rel="stylesheet" />
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/tablleColor.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/laydate/laydate.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/electricityTableAjax.js"></script>
    <script type="application/javascript">
        data = ${result};
    </script>
    <script src="${pageContext.request.contextPath}/static/js/stationRunTablePage.js"></script>
</head>
<body>
<div class="top">
    <div class="top-left">
        <div class="kong"></div>
        <div class="logo">
            <img src="${pageContext.request.contextPath}/static/imgs/logo3.png">
        </div>
    </div>
    <div class="top-right">
        <ul class="list">
            <li><a href="${pageContext.request.contextPath}/powerCenter.action?username=${username}">电站中心</a></li>
            <li><a href="checkCenter.jsp">运维中心</a></li>
            <li><a href="${pageContext.request.contextPath}/InReportCenter">报表中心</a></li>
            <li><a href="${pageContext.request.contextPath}/centralizedControl">展示中心</a></li>
            <% if(session.getAttribute("users")!=null){
                Users users = (Users)session.getAttribute("users");
            %>
            <% if(users.getType()==1){%>
            <li><a href="${pageContext.request.contextPath}/InidManage">账号管理</a></li>
            <% }%>
            <% } %>
            <li><a href="${pageContext.request.contextPath}/checkOut.action" ><span class="fa fa-user"></span></a></li>
        </ul>
    </div>
</div>
<div class="main">
    <div class="left">
        <div class="side" id="side">
            <form id="myForm" action="" method="post">
                <div class="box">
                    <input type="text" placeholder="选择具体日期" id="test1" value="" class="text-center" name="date1">
                </div>
                <div class="box">
                    <!--<button id="test1">选择时间段</button>-->
                    <input type="text" placeholder="选择时间段" id="test2" value="" class="text-center" name="date2">
                </div>
                <div class="box">
                    <select name="idTest">
                        <c:forEach items="${powers}" var="p">
                            <c:if test="${selected.equals(p.powerId)}">
                                <option value="${p.powerId}" selected="selected">${p.powerName}</option>
                            </c:if>

                            <c:if test="${!selected.equals(p.powerId)}">
                                <option value="${p.powerId}">${p.powerName}</option>
                            </c:if>
                        </c:forEach>
                    </select>
                </div>
                <div class="box">
                    <input type="button" value="导出表格" onclick="beforeSubmit('ExcelOut_Example3')">
                </div>
                <div class="box">
                    <input type="button" value="搜 索" class="text-center" onclick="beforeSubmit('InElectricityTable')" >
                </div>
                <div class="box kong2">

                </div>
            </form>
        </div>
    </div>
    <div class="center">
        <table class="table table-bordered table-striped" id="dataTable" >

        </table>
        <div id="ui-page" class="ui-page">

        </div>
    </div>
</div>
<script>
    var myDate = new Date();//获取系统当前时间
    var today=myDate.toLocaleDateString()//获取当前日期
    //执行一个laydate实例
    laydate.render({
        elem: '#test1', //指定元素
        max:today
    });
    laydate.render({
        elem: '#test2', //指定元素
        range: true,
        max:today

    });
</script>
<script src="${pageContext.request.contextPath}/static/js/TablePage.js"></script>
<script type="text/javascript">
    if(${pageNum} != null)
    {
        if(${pageNum == 1}) {
            var initTotalPageNum = 2;
            $("#ui-page").paging({pageSize:1,totalPage:initTotalPageNum});
            document.getElementsByClassName('page')[0].click();
            document.getElementById('next').style.display='none';
            document.getElementById('end').style.display='none';
        } else {
            var initTotalPageNum = ${pageNum};
            $("#ui-page").paging({pageSize:3,totalPage:initTotalPageNum});
            document.getElementsByClassName('page')[0].click();
        }
    }
</script>
</body>
</html>
